Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[576] Add back the afterAll and beforeEach callbacks. The TestRu… #577

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

jamezp
Copy link
Collaborator

@jamezp jamezp commented Jul 2, 2024

…nnerAdaptor.before() and TestRunnerAdaptor.after() need to happen in the beforeEach and afterEach listeners.

Short description of what this resolves:

The BeforeEachCallback and AfterEachCallback callbacks need to be added back for JUnit 5. It looks like the resource injection needs to happen in this context to work.

resolves #576

…daptor.before() and TestRunnerAdaptor.after() need to happen in the beforeEach and afterEach listeners.
@jamezp jamezp force-pushed the fix-junit5-extension branch from 87eb8a1 to 76cefee Compare July 2, 2024 02:40
@jamezp jamezp changed the title [ARQ-2231] Add back the afterAll and beforeEach callbacks. The TestRu… [576] Add back the afterAll and beforeEach callbacks. The TestRu… Jul 2, 2024
@lprimak
Copy link
Contributor

lprimak commented Jul 2, 2024

Any chance you can test / merge #314 ?
JUnit 5 lifecycle tests

@lprimak
Copy link
Contributor

lprimak commented Jul 2, 2024

Also why is TestNG container failing?

@jamezp jamezp requested a review from rhusar July 2, 2024 03:22
@jamezp
Copy link
Collaborator Author

jamezp commented Jul 2, 2024

Any chance you can test / merge #314 ? JUnit 5 lifecycle tests

I think we need to decide whether we should be running tests requiring implementations here, or if the implementations should be testing with CI and SNAPSHOT builds.

For https://github.com/wildfly/wildfly-arquillian I was planning on adding SNAPSHOT testing there for each push and a nightly job.

@jamezp
Copy link
Collaborator Author

jamezp commented Jul 2, 2024

Also why is TestNG container failing?

I'm not sure I follow, what do you mean by TestNG failing?

@lprimak
Copy link
Contributor

lprimak commented Jul 2, 2024

Testing https://github.com/flowlogix/test-arq-suite/tree/TestNG with Arquillian 1.8.1.Final fails.
1.8.0.Final succeeds. This fix only touches JUnit5 yet there is still something wrong with TestNG container

@jamezp
Copy link
Collaborator Author

jamezp commented Jul 2, 2024

Testing https://github.com/flowlogix/test-arq-suite/tree/TestNG with Arquillian 1.8.1.Final fails. 1.8.0.Final succeeds. This fix only touches JUnit5 yet there is still something wrong with TestNG container

This fix is only for JUnit 5. I'm not sure what would fail with TestNG. I don't really see anything obvious, but you could file a new issue. The error seems to be something like:

Caused by: java.lang.reflect.MalformedParameterizedTypeException: Mismatch of count of formal and actual type arguments in constructor of org.jboss.arquillian.container.spi.Container: 0 formal argument(s) 1 actual argument(s)
	at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:59)
	at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:52)
	at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:100)
	at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
	at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
	at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
	at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
	at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
	at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
	at java.base/sun.reflect.generics.repository.FieldRepository.computeGenericType(FieldRepository.java:90)
	at java.base/sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:82)
	at java.base/java.lang.reflect.Field.getGenericType(Field.java:276)
	at org.jboss.arquillian.core.impl.InjectionPointImpl.getType(InjectionPointImpl.java:61)
	at org.jboss.arquillian.core.impl.ManagerImpl.injectInstances(ManagerImpl.java:492)
	at org.jboss.arquillian.core.impl.ManagerImpl.inject(ManagerImpl.java:483)
	at org.jboss.arquillian.core.impl.ManagerImpl.inject(ManagerImpl.java:184)
	at org.jboss.arquillian.core.impl.InjectorImpl.inject(InjectorImpl.java:54)
	at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:73)
	... 69 more

Anyway, that's definitely a different issue.

@lprimak
Copy link
Contributor

lprimak commented Jul 2, 2024

Unfortunately I can't do a "real" test yet b/c Jakarta 1.8.1 isn't synced to maven central yet...

@starksm64 starksm64 merged commit e7d8825 into arquillian:master Jul 2, 2024
3 checks passed
@lprimak
Copy link
Contributor

lprimak commented Jul 3, 2024

Confirmed. Both TestNG and JUnit 5 work with the latest SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wildfly-arquillian build against arquillian-core 1.8.1.Final fails junit test
3 participants